package com.orange.handler.impl;

import java.sql.SQLException;
import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.orange.handler.AuthSubjectService;
import com.orange.modules.dao.manage.AuthSubjectRepository;
import com.orange.modules.entity.manage.AuthSubject;
@Service
public class AuthSubjectServiceImpl implements AuthSubjectService {

	@Autowired
	private AuthSubjectRepository authSubjectRepository;
	
	@Override
	public void saveAuthSubject(AuthSubject as) {
		authSubjectRepository.saveAuthSubject(as);
	}

	@Override
	public List<AuthSubject> queryAuthSubjectByTaskId(String taskId)
			throws SQLException {
		List<AuthSubject> list = authSubjectRepository.queryAuthSubjectByTaskId(taskId);
		return list;
	}

	@Override
	public List<AuthSubject> queryAllAuthSubject() throws SQLException {
		List<AuthSubject> list = authSubjectRepository.queryAllAuthSubject();
		return list;
	}

	@Override
	public AuthSubject queryAuthSubjectByPId(String pid)
			throws SQLException {
		AuthSubject list = authSubjectRepository.queryAuthSubjectByPId(pid);
		return list;
	}

	@Override
	public List<AuthSubject> queryAuthSubjectByExam(String taskId)
			throws SQLException {
		List<AuthSubject> list = authSubjectRepository.queryAuthSubjectByExam(taskId);
		return list;
	}

	@Override
	public void updataAuthSubject(AuthSubject as) {
		authSubjectRepository.saveAuthSubject(as);
		
	}

	@Override
	public void deleteAuthSubject(String pid) {
		authSubjectRepository.deleteAuthSubject(pid);
	}

}
